function plot_fig(x_max,N,res1,res2,res3)
h = x_max/N;
m1 = size(res1,2);
figure;
subplot(2,2,1)
plot(0:h:(m1-1)*h,res1,'.-');xlim([0 2*pi]);ylim([-1 1]);title('(a)');
subplot(2,2,2)
plot(0:h:(m-1)*h,res2,'.-');xlim([0 2*pi]);ylim([-1 1]);title('(b)');
subplot(2,2,3)
plot(0:h:(m-1)*h,res3,'.-');xlim([0 2*pi]);ylim([-1 1]);title('reference');

